<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<script type="text/javascript" src="../layui/layui.js" ></script>
	</head>
	<body>
		<div class="layui-tab page-content-wrap">
		  <ul class="layui-tab-title">
		    <li class="layui-this">离/换寝申请</li>
		    <li>换/寝查询</li>
		  </ul>
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show">
		    	<form class="layui-form"  style="width: 90%;padding-top: 20px;">
				  <div class="layui-form-item">
				    <label class="layui-form-label">学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</label>
				    <div class="layui-input-inline">
				      <input type="text" name="id" disabled autocomplete="off" class="layui-input layui-disabled" value="1">
				    </div>
				    <label class="layui-form-label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
				    <div class="layui-input-inline">
				      <input type="text" name="username" disabled autocomplete="off" class="layui-input layui-disabled" value="admin">
				    </div>
				    <label class="layui-form-label">申请类型：</label>
				    <div class="layui-input-inline">
				      <select class="layui-select" lay-filter="apply_type">
				      	<option value="请选择申请类型" >请选择申请类型</option>
				      	<option value="离寝申请" selected="">离寝申请</option>
				      	<option value="换寝申请">换寝申请</option>
				      </select>
				    </div>
				  </div>
				  
				   <div class="layui-form-item " lay-filter="floor_info" id="floor_info">
				    <label class="layui-form-label">住宿信息：</label>
				    <div class="layui-input-inline">
				      <select class="layui-select" disabled="">
				      	<option value="请选择楼栋">请选择楼栋</option>
				      	<option value="三栋" selected="">三栋</option>
				      </select>
				    </div>
				    <div class="layui-input-inline ">
				      <select class="layui-select" disabled="">
				      	<option value="请选择楼层">请选择楼层</option>
				      	<option value="第三层" selected="">第三层</option>
				      </select>
				    </div>
				    <div class="layui-input-inline">
				      <select class="layui-select" disabled="">
				      	<option value="请选择宿舍">请选择宿舍</option>
				      	<option value="三栋" selected="">30X</option>
				      </select>
				    </div>
				  </div>
				  <div class="layui-form-item" lay-filter="college_info" id="college_info">
				  	<label class="layui-form-label">所属学院：</label>
				  	<div class="layui-input-inline">
				  		<select class="layui-select" disabled="">
				  			<option value="请选择学院">请选择学院</option>
				  			<option value="信息工程学院" selected="">信息工程学院</option>
				  		</select>
				  	</div>
				  	<div class="layui-input-inline">
				  		<select class="layui-select" disabled="">
				  			<option value="请选择专业">请选择专业</option>
				  			<option value="软件技术" selected="">软件技术</option>
				  		</select>
				  	</div>
				  	<div class="layui-input-inline">
				  		<select class="layui-select" disabled="">
				  			<option value="请选择班级">请选择班级</option>
				  			<option value="160X" selected="">160X</option>
				  		</select>
				  	</div>
				  </div>
				  
				  <div class="layui-form-item layui-hide" id="new_dorm_select">
				  	<label class="layui-form-label">调换宿舍：</label>
				  	<div class="layui-input-inline">
				      <select class="layui-select" >
				      	<option value="请选择楼栋" selected="">请选择楼栋</option>
				      	<option value="三栋" >三栋</option>
				      </select>
				    </div>
				    <div class="layui-input-inline ">
				      <select class="layui-select" >
				      	<option value="请选择楼层" selected="">请选择楼层</option>
				      	<option value="第三层" >第三层</option>
				      </select>
				    </div>
				    <div class="layui-input-inline">
				      <select class="layui-select" >
				      	<option value="请选择宿舍" selected="">请选择宿舍</option>
				      	<option value="三栋" >30X</option>
				      </select>
				    </div>
				  </div>
				  <div class="layui-form-item" id="telephone">
				    <label class="layui-form-label">联系方式：</label>
				    <div class="layui-input-block">
				      <input type="text" name="telephone" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input" value="tel:18374770000">
				    </div>
				  </div>
				  <div class="layui-form-item layui-form-text">
				    <label class="layui-form-label" id="dorm_text">离寝理由：</label>
				    <div class="layui-input-block">
				      <textarea name="desc" placeholder="请输入理由" class="layui-textarea"></textarea>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="adminInfo">立即提交</button>
				    </div>
				  </div>
				</form>
		    </div>
		    <div class="layui-tab-item">
		    	<form class="layui-form" v style="width: 90%;padding-top: 20px;">
				  <div class="layui-form-item">
				    <label class="layui-form-label">用户名：</label>
				    <div class="layui-input-block">
				      <input type="text" name="username" disabled autocomplete="off" class="layui-input layui-disabled" value="admin">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">旧密码：</label>
				    <div class="layui-input-block">
				      <input type="password" name="password1" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">新密码：</label>
				    <div class="layui-input-block">
				      <input type="password" name="password2" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">重复密码：</label>
				    <div class="layui-input-block">
				      <input type="password" name="password3" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <div class="layui-input-block">
				      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="adminPassword">立即提交</button>
				    </div>
				  </div>
				</form>
		    </div>
		  </div>
		</div>
		
	<script>
		//Demo
		layui.use(['form','element','jquery'], function(){
		  var form = layui.form;
		  var element = layui.element;
		  var $ = layui.jquery;
		  form.render();
		  //监听select Apply_type 
		  form.on('select(apply_type)',function(data){
		  	var value = data.value;
		  	if(value == "离寝申请"){
		  		console.log(1);
		  		$("#new_dorm_select").addClass("layui-hide");
		  		$("#college_info").removeClass("layui-hide");
		  		$('#dorm_text').html("离寝申请：");
		  	}else if(value == "换寝申请"){
		  		$("#new_dorm_select").removeClass("layui-hide");
		  		$("#college_info").addClass("layui-hide");
				$('#dorm_text').html("换寝申请：");
		  		console.log(values);
		  	}
		  });
		  //监听信息提交
		  form.on('submit(adminInfo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		  //监听密码提交
		   form.on('submit(adminPassword)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		});
	</script>
	</body>
</html>
